package main

import (
	"fmt"
)

func main() {
	c := make(chan int, 0)

	go func() {
		defer fmt.Println("子协程结束")

		fmt.Println("子协程正在运行……")
		//发送数据6到c
		c <- 6
	}()
	//等待接收c数据赋值给num
	num := <-c

	fmt.Println(num)
	fmt.Println("main协程结束")
}
